
(in-package :gen-res)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defparameter *everything*
  (list ; *actors*
        ;*features*
        ; *configuration-items*
        ;*meetings*
        
        ; *mile-stones* 
        ;*current-build-numbers*
        ;*roadmap*
        ;*slips*
        
        ;*agenda-items*
        ;*references*
        
        ;*lessons-learned*
        ;*risks*
        ;*action-items* 
        
        )
  )

(defun commit-universe ()
  
  ( commit-resources-from-list *the-subject-list* )
  ( commit-properties-from-list *the-property-list*) 
  ( commit-subclases-from-list *the-subclass-list* )
  ( commit-range-and-domain-from-list *range-and-domain* )

  ; (mapcar #'commit-all-resources-as-list *everything*)
  (db.agraph.user::index-all-triples)
  
  ; (make-all-done *done-things*)
  )


(defun commit-named-universe ()
  
  ; (setf db.agraph.user::*default-pathname-defaults* "C:\\allegro-rep")
  
  ; don't create the triple store; it should already be open.
  ; (db.agraph.user::create-triple-store the-triplestore-name  :if-exists :supersede)  
  
  ;(gen-res::destroy-everything)
      
  (gen-res::commit-universe)
  
  (db.agraph.user::triple-count)
      
  )

;;;(defun cnu ( &optional (n 3) (close-after t) ) 
;;;  (let (
;;;        ( x 0)
;;;        (the-name (format nil "rdf-0~a" n))
;;;        )
;;;  ( commit-named-universe the-name)
;;;    (setq x   (db.agraph.user::triple-count) )
;;;    
;;;    (with-open-file 
;;;        (s "D:\\r\\out.rdf" :direction :output :if-exists :supersede) 
;;;      (db.agraph.user::serialize-ntriples db.agraph.user::*db* s))
;;;    
;;;    (when close-after 
;;;    (db.agraph.user::close-triple-store))
;;;    x
;;;    ))
;;;
;;;(defmacro cnuo () (cnu 3 nil))
;;;
;;;
;;;(defun cnu-out ()
;;;  (with-open-file 
;;;      (s "out.rdf" :direction :output :if-exists :supersede) 
;;;    (db.agraph.user::serialize-ntriples db.agraph.user::*db* s)
;;;  ))

  


        
        
        
        









